/*
package com.lantosec.hmrp.modules.sysdata.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lantosec.hmrp.core.kit.Result;
import com.lantosec.hmrp.core.mvc.BaseController;
import com.lantosec.hmrp.modules.sysdata.entity.SysDataForm;
import com.lantosec.hmrp.modules.sysdata.service.ISysDataFormExtService;
import com.lantosec.hmrp.modules.sysdata.service.ISysDataFormService;
import com.lantosec.hmrp.modules.sysdata.vo.SysDataFormVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.log4j.Log4j2;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.BindingResult;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.Arrays;
import java.util.List;

*/
/**
 * 系统数据表单定义表 控制器
 *
 * @author AutoCode
 * @since 2020-03-02
 *//*

@Api(value = "系统数据表单定义表控制器", tags = "系统数据表单定义表控制器")
@RestController
@RequestMapping("/autoform")
@Log4j2
public class SysDataFormController extends BaseController {
    @Autowired
    private ISysDataFormService service;

    @Autowired
    private ISysDataFormExtService extService;

    @GetMapping("all")
    @ApiOperation(value = "查询全部")
    public Result<List<SysDataFormVO>> all() {
        return Result.ok(entity2VO(service.list()));
    }

    @GetMapping("page")
    @ApiOperation(value = "分页查询")
    public Result<Page<SysDataFormVO>> page(@ApiParam(value = "分页对象", required = true) Page<SysDataForm> page, SysDataFormVO condition) {
        page = service.page(page,
                new QueryWrapper<SysDataForm>()
                        .like(StringUtils.isNotEmpty(condition.getDataFormId()), SysDataForm.ColName.data_form_id.toString(), condition.getDataFormId())
                        .or()
                        .like(StringUtils.isNotEmpty(condition.getDataFormName()), SysDataForm.ColName.data_form_name.toString(), condition.getDataFormName())
        );
        return Result.ok(entity2VO(page));
    }

    @GetMapping("get/{id}")
    @ApiOperation(value = "主键查询")
    public Result<SysDataFormVO> get(@ApiParam(value = "ID", required = true) @PathVariable(name = "id") String id) {
        return Result.ok(service.get(id));
    }

    @GetMapping("getByModelId/{id}")
    @ApiOperation(value = "根据模型ID查询")
    public Result<SysDataFormVO> getByModelId(@ApiParam(value = "ID", required = true) @PathVariable(name = "id") String id) {
        return Result.ok(service.getByModelId(id));
    }

    @PostMapping("create")
    @ApiOperation("新增数据")
    public Result<SysDataFormVO> create(@ApiParam(value = "系统数据表单定义表VO对象", required = true) @RequestBody @Validated SysDataFormVO vo, BindingResult bindingResult) {
        validationHandler(bindingResult);
        vo = service.create(vo);
        return Result.ok(vo);
    }

    @PutMapping("update")
    @ApiOperation(value = "修改数据")
    public Result<Void> update(@ApiParam(value = "系统数据表单定义表VO对象", required = true) @RequestBody SysDataFormVO vo) {
        SysDataForm entity = vo.convertToEntity();
        service.updateById(entity);
        return Result.ok();
    }

    @DeleteMapping(value = "delete/{ids}")
    @ApiOperation("逻辑删除")
    public Result<Void> delete(@ApiParam(value = "ID列表,用逗号分隔", required = true) @PathVariable(name = "ids") String ids) {
        if (StringUtils.isNotEmpty(ids)) {
            service.removeByIds(Arrays.asList(ids.split(",")));
        }
        return Result.ok();
    }
}
*/
